#pragma once

#include "Point3d.h"
#include "Vector3d.h"
#include "Triangle3d.h"

class Plane3d
  {
  public:
    //plane defined by parameters
    Plane3d(double i_a, double i_b, double i_c, double i_d);
    //plane defined by the normal vector and a point on the plane
    Plane3d(Point3d i_point, Vector3d i_normal);
    //plane defined by three points
    Plane3d(Point3d i_first, Point3d i_second, Point3d i_third);
    //plane defined by triangle
    Plane3d(Triangle3d i_triangle);

    double GetA();
    double GetB();
    double GetC();
    double GetD();

    bool IsParallel( Plane3d i_plane);
    bool IsPerpendicular( Plane3d i_plane);
    bool IsSame( Plane3d i_plane);

    double GetDistanceFromPoint(Point3d i_point);
  private:
    double m_a, m_b, m_c, m_d;
  };